<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/html" xmlns:th="http://www.thymeleaf.org">
<head th:replace="/navbar::header(订单)">
</head>
<body>
<!--导航-->
<nav th:replace="/navbar::naver"></nav>
<!--内容-->
<div class="hdd" style="margin-bottom: 7%">
    <ul class="nav navbar-nav mr-auto mt-2 mt-lg-0">
        <li><a class="a" style="color: #000000" th:href="@{/user/control}">用户信息页</a></li>
        <li style="background-color:#00acee"><a class="a" style="color: #000000" th:href="@{/user/control1}">订单</a></li>
        <li><a class="a" style="color: #000000" th:href="@{/user/control2}">修改</a></li>
    </ul>
</div>
<div class="hdd3">
    <table class="table table-bordered table-striped" style="width: 97%;margin-left: 2.5%">
    <thead class="thead-dark rounded-md">
    <tr>
        <th>订单号</th>
        <th>电影名称</th>
        <th>座位</th>
        <th>场次</th>
        <th>购买数量</th>
        <th>购买金额</th>
        <th>动作</th>
    </tr>
    </thead>
    <tbody>
    <tr th:each="order:${page.getRecords()}">
        <td th:text="${order.OId}"></td>
        <td th:text="${order.MName}"></td>
        <td th:text="${order.seat}"></td>
        <td th:text="${order.times}"></td>
        <td th:text="${order.quantity}"></td>
        <td th:text="${order.amount}"></td>
        <td>
            <a class="btn btn-info btn-sm" th:href="@{/user/control1/see(id=${order.OId})}">查看</a>
            <a class="btn btn-danger btn-sm" onclick="if (!(confirm('你确定去删除这个订单吗'))) return false"
               th:href="@{/user/control1/delete(id=${order.OId})}"
               th:name="id"
            >删除</a>
        </td>
    </tr>
    </tbody>
    </table>
    <div style="position: absolute;top: 60%;margin-left: 1%">
        当前第[[${page.current}]]页 共[[${page.pages}]]页
    </div>
    <div style="position: absolute;top: 60%;left: 69%">
        <th:block th:if="${page.current>1}">
            <a class="btn btn-primary" th:href="@{/user/control1(i=${page.getCurrent()-1})}">上一页</a>
        </th:block>
        <th:block th:if="${page.current==1}">
            <a class="btn btn-primary" href="#" onclick="(confirm(`好兄弟到顶啦`))">上一页</a>
        </th:block>
        <th:block th:if="${page.getCurrent}==${page.getPages()}">
            <a class="btn btn-primary" href="#" onclick="(confirm(`好兄弟到底啦`))">下一页</a>
        </th:block>
        <th:block th:if="${page.getCurrent}!=${page.getPages()}">
            <a class="btn btn-primary" th:href="@{/user/control1(i=${page.getCurrent()+1})}">下一页</a>
        </th:block>
    </div>
</div>
<!--页尾-->
<footer th:replace="/navbar::footer"></footer>
</body>
</html>